import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { XyywShopProductCollectForm, XyywShopProductCollectQuery, XyywShopProductCollectVo } from '@/api/xyyw/model/shopProductCollectModel';
import { request } from '@/utils/request';

// 查询商铺商品收藏列表
export function listShopProductCollect(query?: XyywShopProductCollectQuery) {
  return request.get<TableDataInfo<XyywShopProductCollectVo>>({
    url: '/xyyw/shopProductCollect/list',
    params: query,
  });
}

// 查询商铺商品收藏详细
export function getShopProductCollect(shopProductCollectId: number) {
  return request.get<R<XyywShopProductCollectVo>>({
    url: `/xyyw/shopProductCollect/${shopProductCollectId}`,
  });
}

// 新增商铺商品收藏
export function addShopProductCollect(data: XyywShopProductCollectForm) {
  return request.post<R<void>>({
    url: '/xyyw/shopProductCollect',
    data,
  });
}

// 修改商铺商品收藏
export function updateShopProductCollect(data: XyywShopProductCollectForm) {
  return request.put<R<void>>({
    url: '/xyyw/shopProductCollect',
    data,
  });
}

// 删除商铺商品收藏
export function delShopProductCollect(shopProductCollectIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/xyyw/shopProductCollect/${shopProductCollectIds}`,
  });
}
